home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume3 / turbo_patch < prev    next >
Encoding:
Internet Message Format  |  1986-11-30  |  3.9 KB

  1. From: cmcl2!lanl!jp (James Potter)
  2. Subject: Software Tools in Turbo - SHELL.PAS
  3. Newsgroups: mod.sources
  4. Approved: jpn@panda.UUCP
  5.  
  6. Mod.sources:  Volume 3, Issue 50
  7. Submitted by: harvard!cmcl2!lanl!jp (James Potter)
  8.  
  9.  
  10. [ As some of you have noticed, the file "SHELL.PAS" in the recent
  11.   Software Tools in Turbo Pascal was sent out scronked.  Thanks for
  12.   your patience          -  John P. Nelson (moderator, mod.sources)
  13. ]
  14.  
  15. John,  Sorry about the screw-up on the Turbo Pascal file SHELL.PAS.
  16. Apparently it got fouled up when I uploaded it and I didn't have a
  17. way of checking it out easily.  Anyway, here is the correct file SHELL.PAS
  18.  
  19. James Potter
  20.  
  21. #! /bin/sh
  22. # This is a shell archive, meaning:
  23. # 1. Remove everything above the #! /bin/sh line.
  24. # 2. Save the resulting text in a file.
  25. # 3. Execute the file with /bin/sh (not csh) to create the files:
  26. #    shell.pas
  27. # This archive created: Wed Nov 20 07:40:39 1985
  28. export PATH; PATH=/bin:$PATH
  29. echo shar: extracting "'shell.pas'" '(2654 characters)'
  30. if test -f 'shell.pas'
  31. then
  32.     echo shar: will not over-write existing file "'shell.pas'"
  33. else
  34. cat << \SHAR_EOF > 'shell.pas'
  35. {SHELL.PAS}
  36.  
  37. {
  38.         Copyright (c) 1981
  39.         By:     Bell Telephone Laboratories, Inc. and
  40.                 Whitesmith's Ltd.,
  41.  
  42.         This software is derived from the book
  43.                 "Software Tools in Pascal", by
  44.                 Brian W. Kernighan and P. J. Plauger
  45.                 Addison-Wesley, 1981
  46.                 ISBN 0-201-10342-7
  47.  
  48.         Right is hereby granted to freely distribute or duplicate this
  49.         software, providing distribution or duplication is not for profit
  50.         or other commercial gain and that this copyright notice remains
  51.         intact.
  52. }
  53.  
  54. PROGRAM TOOLS;
  55. {$I TOOLU.PAS}
  56. {$I INITCMD.PAS}
  57. {$I CHAPTER1.PAS}
  58. {$I CHAPTER2.PAS}
  59. {$I CHAPTER3.PAS}
  60. {$I CHAPTER4.PAS}
  61. {$I CHAPTER5.PAS}
  62. {$I CHAPTER6.PAS}
  63. {$I CHAPTER7.PAS}
  64. {$I CHAPTER8.PAS}
  65.  
  66.  
  67.  
  68. VAR
  69.   STR,STR1:STRING80;
  70.   COMMAND:XSTRING;
  71.   DONE:BOOLEAN;
  72.   I:INTEGER;
  73.  
  74.  
  75.  
  76.  
  77.  
  78. BEGIN {SHELL}
  79.  
  80. DONE:=FALSE;
  81. WHILE NOT DONE
  82. DO
  83.     BEGIN
  84.     INITCMD;
  85.     IF GETARG(1,COMMAND,MAXSTR)
  86.     THEN
  87.         BEGIN
  88.         STR:='';
  89.         STR1:='X';
  90.         FOR I:=1 TO XLENGTH(COMMAND)
  91.         DO
  92.             BEGIN
  93.             if COMMAND[I]in[97..122]
  94.             then
  95.                 str1[1]:=chr(command[i]-32)
  96.             ELSE STR1[1]:=chr(COMMAND[I]);
  97.             STR:=CONCAT(STR,STR1)
  98.             END;
  99.         if str = 'COPY' then copy
  100.         else if str = 'LINECOUNT' then linecount
  101.         else if str = 'WORDCOUNT' then wordcount
  102.         else if str = 'DETAB' then detab
  103.         else if str = 'ENTAB' then entab
  104.         else if str = 'OVERSTRIKE' then overstrike
  105.         else if str = 'COMPRESS' then compress
  106.         else if str = 'EXPAND' then expand
  107.         else if str = 'ECHO' then echo
  108.         else if str = 'TRANSLIT' then translit
  109.         else if str = 'COMPARE' then compare
  110.         else if str = 'INCLUDE' then include
  111.         else if str = 'CONCAT' then concat
  112.         else if str = 'PRINT' then print
  113.         else if str = 'MAKECOPY' then makecopy
  114.         else if str = 'ARCHIVE' then archive
  115.         else if str = 'SORT' then sort
  116.         else if str = 'UNIQUE' then unique
  117.         else if str = 'KWIC' then kwic
  118.         else if str = 'ROTATE' then writeln('ROTATE not directly supported.')
  119.         else if str = 'UNROTATE' then unrotate
  120.         else if str = 'FIND' then find
  121.         else if str = 'CHANGE' then change
  122.         else if str = 'EDIT' then edit
  123.         else if str = 'FORMAT' then format
  124.         else if str = 'DEFINE' then macro
  125.         else if str = 'MACRO' then macro
  126.         else if str = 'QUIT' then halt
  127.         ELSE
  128.             BEGIN
  129.             WRITELN('?');
  130.             DONE:=FALSE
  131.             END
  132.         END;
  133.     endcmd;
  134.     END;
  135.  
  136. END.
  137. SHAR_EOF
  138. if test 2654 -ne "`wc -c < 'shell.pas'`"
  139. then
  140.     echo shar: error transmitting "'shell.pas'" '(should have been 2654 characters)'
  141. fi
  142. fi # end of overwriting check
  143. #    End of shell archive
  144. exit 0
  145.